package tbmanager;

import org.hibernate.Session;

import student.Course;
import student.Score;
import student.Student;
import util.HibernateUtil;

public class Test2 {
public static void main(String[] args) {
	Session session=HibernateUtil.getSessionFactory().getCurrentSession();
//	Student student=new Student();
//	student.setName("abc");
//	student.setGender("male");
//	Score score=new Score();
//	score.setScore(87);
//	score.setStudent(student);
	Student student;
	session.beginTransaction();
	student=session.get(Student.class, 1);
	
//	Score score=new Score();
//	score.setScore(88);
//	score.setStudent(student);
//	session.save(score);
//	session.getTransaction().commit();
	System.out.println(student.getName()+" "+student.getGender()+student.getScores().get(0).getScore());
	
}
}
